package cc.comac.mom.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import cc.comac.mom.api.QualityMaterialDataService;
import cc.comac.mom.bean.QualityMaterialData;
import cc.comac.mom.datahandlers.entity.QualityMaterialDataDataHandler;
import cc.comac.mom.util.ResultBean;
@Service
@RestController
public class QualityMaterialDataServiceImpl implements QualityMaterialDataService {
	@Autowired
	private QualityMaterialDataDataHandler QualityMaterialDataDataHandler;
	
	@Override
	public ResultBean insertMaterialBatch(@RequestBody List<QualityMaterialData> materialList) {
		ResultBean resultBean = new ResultBean(true);
		int insert = QualityMaterialDataDataHandler.insert(materialList);
		resultBean.setObject(insert);
		return resultBean;
	}

	@Override
	public QualityMaterialData selectAllByPage(@RequestBody QualityMaterialData QualityMaterialData) {
		QualityMaterialData selectAllByPage = QualityMaterialDataDataHandler.selectAllByPage(QualityMaterialData);
		return selectAllByPage;
	}

}
